package com.zhongen.wflow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongen.admin.api.entity.SysDept;
import com.zhongen.wflow.bean.vo.OrgTreeVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : willian fu
 * @date : 2022/6/27
 */
public interface WflowDepartmentsMapper extends BaseMapper<SysDept> {

	/**
	 * 查询某部门下的子部门列表
	 * @param deptId 父部门
	 * @return 子部门列表，type字段固定返回固定值 dept
	 */
	@Select("SELECT dept_id as id, name , 'dept' AS 'type' FROM sys_dept WHERE parent_id=#{deptId}")
	List<OrgTreeVo> selectByDept(@Param("deptId") String deptId);

}
